#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@Time        : 2021/11/4 15:29
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : coins_morphology.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from skimage.io import imread
from DIP_experiment_5.util import contrast_show
from skimage.morphology import black_tophat, disk

FONT_PATH = "C:/Windows/Fonts/simhei.ttf"
IM_PATH = "../experiment_fig/coins.png"  # RGBA
im = imread(IM_PATH, as_gray=True)  # 读入为greyscale image
disk_elem = disk(radius=20)
black_top_hat_im = black_tophat(im, disk_elem)
im_dict = {"原始图像": im, "黑帽变换图像": black_top_hat_im}
contrast_show(im_dict, (1, 2), font=FONT_PATH)
